1. Field of the Invention
This invention relates to allocating buffers for data retrieval operations.
2. Description of the Related Art
Buffers are often used in connection with input/output (“I/O”) operations to hardware. For example, as a device reads data from a hard disk, it is often read into buffers. Using buffers instead of reading and writing data directly from/to the disk offers significant performance advantages. However, there are limits on the use of buffers; for example, a system may have a limited amount of buffers available. In addition, other jobs on a particular system may be competing for buffers and other resources. Allocating too many buffers for a particular job takes resources away from other jobs and is inefficient. In addition, using too many buffers may result in unnecessary paging and internal processing. However, allocating too few buffers requires that the job get more data from the disk and imposes a performance penalty.
In addition, how data is accessed can be an important factor in buffer allocation. For example, Virtual Storage Access Method (“VSAM”) is an IBM disk file storage access method in z/OS for data in direct access storage devices (“DASD”) such as disk drives. VSAM provides for direct access that allows a particular record to be accessed using a search argument. using a search argument. For example, a bank record may be accessed using a bank account number. VSAM also provides for sequential access that processes (for read or write) one logical record after the other. For example, if an application is totaling the amount of money stored in all bank records, it may trigger sequential access events to simply get one record after the other since it does not need to uniquely identify or access bank records in any particular order.
A VSAM record has an index component and a data component. To facilitate reading VSAM records quickly, a data buffer stores the data component and an index buffer stores the index component. Thus, in addition to allocating the buffers that will be available to a particular job, a process managing buffers must also determine how many index buffers to allocate and how many data buffers to allocate. Misallocating buffer types for the job can result in sub-par performance. Proper allocation of buffer types can be particularly troublesome where the job executes both sequential access events and direct access events, since optimizing for one type of data request imposes costs when the other type is being executed in the job.